package cn.jhc.teachingquality.net.teaching;

import com.android.volley.AuthFailureError;
import com.android.volley.Response;
import com.android.volley.toolbox.JsonArrayRequest;

import org.json.JSONArray;

import java.util.HashMap;
import java.util.Map;

import cn.jhc.teachingquality.net.DefaultResponseErrorListener;

import static cn.jhc.teachingquality.Global.URL_PREFIX;
/**
 * 根据课程的hiddenId查出该课程所有学生的id的请求。
 * Created by luyanfei on 16-4-7.
 */
public class FetchStudentsRequest extends JsonArrayRequest {
    private static final String FETCH_STUDENTS_URL =
            URL_PREFIX + "/jcKcxxAction!getKcFromJcKcxx.shtml";

    private String courseId;

    public FetchStudentsRequest(String courseId, Response.Listener<JSONArray> listener) {
        super(Method.GET,
                FETCH_STUDENTS_URL + "?jcKcxx.id=" + courseId,
                listener,
                new DefaultResponseErrorListener());
        this.courseId = courseId;
    }

//    @Override
//    protected Map<String, String> getParams() throws AuthFailureError {
//        Map<String, String> map = new HashMap<>();
//        //参数中提供课程的hiddenId
//        map.put("jcKcxx.id", courseId);
//        return map;
//    }
}
